package com.heaven.back.service.impl;

import com.heaven.back.mapper.ActionMapper;
import com.heaven.back.pojo.Item;
import com.heaven.back.pojo.Player;
import com.heaven.back.service.ActionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * The type Action serviceimpl.
 */
@Slf4j
@Service
public class ActionServiceimpl implements ActionService {
    @Autowired
    private ActionMapper actionMapper;

    @Override
    public Player Login(Player p) {
        return actionMapper.getByUsernameAndPassword(p);
    }

    @Override
    public void add(Player p) {
        actionMapper.add(p);
    }

    @Override
    public void update(Player player) {
        log.info(String.valueOf("66666666666666666666666666666666" + player.getIslogin()));
        actionMapper.update(player);
    }

    @Override
    public Player searchByid(Integer id) {
        return actionMapper.searchByid(id);
    }

    @Override
    public String image(String room) {
        return actionMapper.searchRoom(room);
    }

    @Override
    public String searchEffect(int eatEffect) {
        return actionMapper.serchEffect(eatEffect);
    }

    @Override
    public List<Item> item() {
        return actionMapper.item();
    }

    @Override
    public ArrayList<String> searchByroom(String roomName) {
        return actionMapper.searchByroom(roomName);
    }

}
